import request from './request';

// 获取课程列表
export const getCourses = () => {
  return request({
    url: '/course/get/version',
    method: 'get'
  });
};

// 获取课程图谱数据
export const getCourseGraphData = (versionId) => {
  return request({
    url: `/course/chart/get/course?versionId=${versionId}`,
    method: 'get'
  });
};

// 获取课程本体列表
export const getCourseNoumenon = () => {
  return request({
    url: '/course/noumenon/get/course',
    method: 'get'
  });
};


// export const getCourseGraphData = (courseId) => {
//   return request({
//     url: `/api/courses/${courseId}/graph`,
//     method: 'get'
//   });
// };

// 添加节点
export const addNode = (data) => {
  return request({
    url: '/api/courses/nodes',
    method: 'post',
    data
  });
};

// 更新节点
export const updateNode = (data) => {
  return request({
    url: `/api/courses/nodes/${data.id}`,
    method: 'put',
    data
  });
};

// 删除节点
export const deleteNode = (nodeId) => {
  return request({
    url: `/api/courses/nodes/${nodeId}`,
    method: 'delete'
  });
}; 